package com.example.demo.listener;

/*4个重要的事件回调机制：《重点》
        // 下面两个配置在META-INF/spring.factories
        ApplicationContextInitializer;
        SpringApplicationRunListener;

        // 下面两个只需要放在IOC容器中；
        ApplicationRunner;
        CommandLineRunner;*/

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @description:
 * @date: 2019/6/11 22:26.
 * @author: yulipeng.
 */
//配置到META-INF/spring.factories
public class HelloApplicationContextInitializer
        implements ApplicationContextInitializer<ConfigurableApplicationContext> { //监听IOC容器的启动
    @Override
    public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
        System.out.println("==============HelloApplicationContextInitializer.initialize()=================="
        + configurableApplicationContext);
    }
}
